package com.wufan.day02;

/**
 * 遍历偶数，输出和，输出个数
 * @author SongWufan
 * @date 2021/3/3 21:31
 */
public class LoopTest {
    public static void main(String[] args) {
        int i = 0;
        int sum = 0;
        int count = 0;
        final int a = 100;
        for(i = 1; i <= a; i++){
            if (i % 2 == 0){
                System.out.println(i);
                sum += i;
                count++;
            }
        }
        System.out.println("总和"+sum+"次数"+count);
    }
}
